home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / Examples ƒ / Space Aliens / 68k Space Aliens / IC Resource API.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-17  |  4.3 KB  |  122 lines  |  [TEXT/SPM ]

  1. /*
  2.     IC R API.h
  3.     
  4.     Header file for ICR* API.
  5.     
  6.     The ICR* routines work directly on resource files.  These routines make up the heart of the
  7.     InternetConfig system, as the rest of the pieces call these routines to do the actual work.
  8.     
  9.     
  10. */
  11.  
  12. #pragma once
  13.  
  14. #ifndef __H_IC_R_API__
  15. #define __H_IC_R_API__
  16.  
  17. /* ICRStruct - Internal structure for the IC system */
  18. /* This is *completely* private to the implementation */
  19.  
  20. #if defined(powerc) || defined (__powerc)
  21. #pragma options align=mac68k
  22. #endif
  23. struct ICRStruct {
  24.     ComponentInstance    instance;            // null if no component available, if not null then rest of the struct is junk
  25.     Boolean            have_config_file;
  26.     FSSpec            config_file;
  27.     short            config_refnum;
  28.     ICPerm            perm;
  29.     Str63            default_filename;
  30.     Str255            prompt;
  31. };
  32. #if defined(powerc) || defined(__powerc)
  33. #pragma options align=reset
  34. #endif
  35.  
  36. typedef struct ICRStruct ICRRecord,* ICRRecordPtr,** *ICRRecordHdl;
  37.  
  38. /* Prototypes */
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. // for information on these routines, see the IC API Descriptions.h file
  44.  
  45. /* ***** Starting Up and Shutting Down ***** */
  46.  
  47. ICError ICRStart(ICRRecordPtr inst,OSType creator);
  48. ICError ICRStop(ICRRecordPtr inst);
  49.  
  50. /* ***** Specifying a Configuration ***** */
  51.  
  52. ICError ICRFindConfigFile(ICRRecordPtr inst,short count,ICDirSpecArrayPtr folders);
  53. ICError ICRFindUserConfigFile(ICRRecordPtr inst,ICDirSpec* where);
  54. ICError ICRGeneralFindConfigFile(ICRRecordPtr inst,Boolean search_prefs,Boolean can_create,short count,ICDirSpecArrayPtr folders);
  55. ICError ICRChooseConfig(ICRRecordPtr inst);
  56. ICError ICRChooseNewConfig(ICRRecordPtr inst);
  57. ICError ICRGetConfigName(ICRRecordPtr inst,Boolean longname,StringPtr name);
  58. ICError ICRGetConfigReference(ICRRecordPtr inst,ICConfigRefHandle ref);
  59. ICError ICRSetConfigReference(ICRRecordPtr inst,ICConfigRefHandle ref,long flags);
  60. ICError ICRSpecifyConfigFile(ICRRecordPtr inst,FSSpecPtr config);
  61.  
  62. /* ***** Getting Information ***** */
  63.  
  64. ICError ICRGetSeed(ICRRecordPtr inst,long* seed);
  65. ICError ICRGetPerm(ICRRecordPtr inst,ICPerm* perm);
  66. ICError ICRDefaultFileName(ICRRecordPtr inst,StringPtr name);
  67.  
  68. /* ***** Reading and Writing Preferences ***** */
  69.  
  70. ICError ICRBegin(ICRRecordPtr inst,ICPerm perm);
  71. ICError ICRGetPref(ICRRecordPtr inst,StringPtr key,ICAttr* attr,Ptr buf,long* size);
  72. ICError ICRSetPref(ICRRecordPtr inst,StringPtr key,ICAttr attr,Ptr buf,long size);
  73. ICError ICRFindPrefHandle(ICRRecordPtr inst,StringPtr key,ICAttr* attr,Handle prefh);
  74. ICError ICRGetPrefHandle(ICRRecordPtr inst,StringPtr key,ICAttr* attr,Handle* prefh);
  75. ICError ICRSetPrefHandle(ICRRecordPtr inst,StringPtr key,ICAttr attr,Handle prefh);
  76. ICError ICRCountPref(ICRRecordPtr inst,long* count);
  77. ICError ICRGetIndPref(ICRRecordPtr inst,long n,StringPtr key);
  78. ICError ICRDeletePref(ICRRecordPtr inst,StringPtr key);
  79. ICError ICREnd(ICRRecordPtr inst);
  80.  
  81. /* ***** User Interface Stuff ***** */
  82.  
  83. ICError ICREditPreferences(ICRRecordPtr inst,StringPtr key);
  84.  
  85. /* ***** URL Handling ***** */
  86.  
  87. ICError ICRParseURL(ICRRecordPtr inst,StringPtr hint,Ptr data,long len,long* selStart,long* selEnd,Handle url);
  88. ICError ICRLaunchURL(ICRRecordPtr inst,StringPtr hint,Ptr data,long len,long* selStart,long* selEnd);
  89.  
  90. /* ***** Mappings Routines *****
  91. * Routines for interrogating mappings database.
  92. * ----- High Level Routines -----
  93. */
  94.  
  95. ICError ICRMapFilename(ICRRecordPtr inst,StringPtr filename,ICMapEntry* entry);
  96. ICError ICRMapTypeCreator(ICRRecordPtr inst,OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry);
  97.  
  98. /* ----- Mid Level Routines ----- */
  99.  
  100. ICError ICRMapEntriesFilename(ICRRecordPtr inst,Handle entries,StringPtr filename,ICMapEntry* entry);
  101. ICError ICRMapEntriesTypeCreator(ICRRecordPtr inst,Handle entries,OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry);
  102.  
  103. /* ----- Low Level Routines ----- */
  104.  
  105. ICError ICRCountMapEntries(ICRRecordPtr inst,Handle entries,long* count);
  106. ICError ICRGetIndMapEntry(ICRRecordPtr inst,Handle entries,long ndx,long* pos,ICMapEntry* entry);
  107. ICError ICRGetMapEntry(ICRRecordPtr inst,Handle entries,long pos,ICMapEntry* entry);
  108. ICError ICRSetMapEntry(ICRRecordPtr inst,Handle entries,long pos,ICMapEntry* entry);
  109. ICError ICRDeleteMapEntry(ICRRecordPtr inst,Handle entries,long pos);
  110. ICError ICRAddMapEntry(ICRRecordPtr inst,Handle entries,ICMapEntry* entry);
  111.  
  112. #ifdef __cplusplus
  113. }
  114. #endif
  115.  
  116. #endif /* __H_IC_R_API__ */
  117.  
  118.  
  119.  
  120.